window.onload = function(){
	let banner = document.querySelector(".banner_center");
	let pointer = document.querySelector("#ul");
	let img = document.querySelector("#img");
	let liAll = document.querySelectorAll("#li");
	let imgArr = ["http://img.alicdn.com/imgextra/i3/O1CN01Am8Sra21Zaice06ax_!!6000000006999-2-tps-1130-500.png_q100.jpg_.webp","https://aecpm.alicdn.com/simba/img/TB1W4nPJFXXXXbSXpXXSutbFXXX.jpg","http://img.alicdn.com/tps/i4/https://img.alicdn.com/imgextra/i1/6000000000161/O1CN01iWluZs1D3mPr5ffHu_!!6000000000161-0-octopus.jpg","https://aecpm.alicdn.com/simba/img/TB1_JXrLVXXXXbZXVXXSutbFXXX.jpg","http://img.alicdn.com/tfs/TB1_1OLxQL0gK0jSZFtXXXQCXXa-1130-500.jpg_q100.jpg_.webp","http://img.alicdn.com/tfs/TB148AkSFXXXXa3apXXXXXXXXXX-1130-500.jpg_q100.jpg_.webp"];
	let body = document.querySelector(".banner");
	let bodyColor = ["#f77619","#e5e5e5","#b0e2e3","#e5e5e5","#7493ef","#f9d133"];
	pointer.style.left = (banner.offsetWidth-pointer.offsetWidth)/2+"px";
	
	var index = 0;
	let timeer;
	function style(index){
		for(let i=0;i<liAll.length;i++)
		{
			liAll[i].className = "";
		}
		liAll[index].className="active";
		body.style.backgroundColor = bodyColor[index];
	}
	
	for(let i=0;i<liAll.length;i++)
	{
		liAll[i].index = i;
		liAll[i].onmouseover = function(){
			img.src = imgArr[this.index];
			index = this.index
			style(index);
			clearInterval(timeer);
			// this.index = this.index;
		};
		liAll[i].onmouseout = function(){
			timeer = setInterval(function(){
				index++;
				style(index%6);
				img.src = imgArr[index%6];
			},3000)
		};
	}
	timeer = setInterval(function(){
		index++;
		style(index%6);
		img.src = imgArr[index%6];
	},1000)
};
	